export default {
	methods: {
		/**
		 * 选择图片
		 * @param {Object} callback
		 */
		ChooseImage(callback) {
			uni.chooseImage({
				count: 4, //默认9
				sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图，默认二者都有
				sourceType: ['album'], //从相册选择
				success: (res) => {
					this.$http.upload(this.$config.apiUrl + "/sys/common/upload", {
							filePath: res.tempFilePaths[0],
							name: 'file'
						})
						.then(res => {
							callback(res)
							this.$tip.success("上传成功")
						})
						.catch(err => {
							this.$tip.error(err.data.message)
						})
					this.imgList = res.tempFilePaths
				}
			});
		}
	}
}
